package com.stockz.equity.charting.display.indicator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.stockz.equity.charting.painter.indicator.LineIndicatorPainter;
import com.stockz.equity.charting.util.Constant.OVERLAY;
import com.stockz.equity.indicator.Indicator;
import com.stockz.equity.indicator.stochastics.StochasticsIndicator;
import com.stockz.equity.indicator.stochastics.StochasticsIndicatorConfiguration;
import com.stockz.equity.model.Bar.BarValueType;

@Component
@Lazy
@Scope("prototype")
public class StochasticsIndicatorDisplay extends AbstractDisplayableIndicatorConfiguration {

	@Autowired StochasticsIndicator stochasticsIndicator;
	
	@Override
	public Indicator<StochasticsIndicatorConfiguration> getIndicator() {
		return stochasticsIndicator;
	}
	
	@Override
	public BarValueType getBarValueType() {
		return stochasticsIndicator.getBarValueType();
	}
	
	@Override
	public void setBarValueType(BarValueType barValueType) {
		stochasticsIndicator.setBarValueType(barValueType);
	}
	
	@Override
	public Object getConfiguration() {
		return stochasticsIndicator.getIndicatorConfiguration();
	}
	
	@Override
	public OVERLAY getOverlay() {
		return OVERLAY.INDEPENDENT;
	}
	
	@Override
	public String getDescription() {
		return getShortName()+","+stochasticsIndicator.getIndicatorConfiguration().getSpan()
		+","+stochasticsIndicator.getBarValueType();
	}

	@Override
	public Class<LineIndicatorPainter> getPainterClass() {
		return LineIndicatorPainter.class;
	}

	@Override
	public boolean isOverlappable() {
		return true;
	}

	@Override
	public String getFullName() {
		return "Stochastics";
	}

	@Override
	public String getShortName() {
		return "STO";
	}
}
